<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>
        <?= $form->field($model, 'name')->textInput() ?>
        <?= $form->field($model, 'password')->textInput() ?>
        <?= $form->field($model, 'phone')->textInput() ?>
        <?= $form->field($model, 'site')->textInput() ?>
        <?= $form->field($model, 'imageFile')->label('头像')->fileInput() ?>
        <img src="http://admin.demo.com/<?= Html::encode($model->imageFile); ?>" alt="">
        <div class="form-group">
            <?=
                Html::submitButton($model->isNewRecord ? '创建用户' : '更新用户', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary'])
            ?>
        </div>
    <?php ActiveForm::end(); ?>
</div>


